package com.example.springbootlocal.system.service.impl;

import com.example.springbootlocal.system.domain.Log;
import com.example.springbootlocal.system.domain.vo.PageVo;
import com.example.springbootlocal.system.service.LogService;
import com.example.springbootlocal.utils.ObjectUtils;
import com.example.springbootlocal.utils.page.IPage;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author X.I.O
 * @title: LogServiceImpl
 * @projectName spring-boot-local
 * @description: TODO
 * @date 2021/11/11 14:50
 */
@Service
public class LogServiceImpl implements LogService {

    @Override
    public void saveLog(Log log) {
        ObjectUtils.autoNumSaveObjById(log);
    }

    @Override
    public Log getLogById(Integer id) {
        Log log=ObjectUtils.getById(Log.class,id);
        return log;
    }

    @Override
    public IPage<Log> getLogPage(int page, int size, String keyword) {
        IPage<Log> page1=ObjectUtils.searchPageByKeyword(Log.class,keyword,page,size);
        return page1;
    }

    @Override
    public IPage<Log> getLogPage(PageVo<Log> pageVo) {
        IPage<Log> page1=ObjectUtils.searchPageByKeyword(pageVo);
        return page1;
    }


    @Override
    public void saveList(List<Log> logList) {
        ObjectUtils.autoNumSaveListById(logList);
    }
}
